﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteContent.Master" Inherits="System.Web.Mvc.ViewPage<ProjectFitus.Models.ArticleContent>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Brjostagjof.is | Ný grein
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Setja inn nýja grein</h2>

    <% using (Html.BeginForm()) {%>
        <%= Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Ný grein</legend>

            <div class="editor-label">
                <label for="isActive">Birta grein: </label>
            </div>
            <div class="editor-field">
                <%= Html.CheckBoxFor(model => model.isActive) %>
                <%= Html.ValidationMessageFor(model => model.isActive) %>
            </div>
                        
            <div class="editor-label">
                <label for="title">Fyrirsögn:</label>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.title)%>
                <%= Html.ValidationMessageFor(model => model.title) %>
            </div>

            <div class="editor-label">
                <label for="contentText">Flokkur:</label>
            </div>
            <div class="editor-field">
            <%= Html.DropDownList("Cats", ViewData["Cats"] as SelectList) %>
            </div>

            <div class="editor-label">
                <label for="contentText">Bæta við höfundi:</label>
            </div>
            <div class="editor-field">
                <select multiple="multiple" id="AuthorList" name="AuthorList">
                <% foreach (var authorItem in ViewData["AuthorList"] as IEnumerable<SelectListItem>)
                   { %>
                   <option value="<%: authorItem.Value %>"><%: authorItem.Text%></option>
                <% } %>
                </select>
            </div>
            
            <div class="editor-label">
                <label for="contentText">Grein:</label>
            </div>
            <div class="editor-field">
                <%= Html.TextAreaFor(model => model.contentText) %>
                <script type="text/javascript">CKEDITOR.replace('contentText');</script>
                <%= Html.ValidationMessageFor(model => model.contentText) %>
            </div>
            
            <div class="editor-label">
                <label for="introText">Útdráttur:</label>
            </div>
            <div class="editor-field">
                <%= Html.TextAreaFor(model => model.introText)%>
                <script type="text/javascript">CKEDITOR.replace('introText');</script>
                <%= Html.ValidationMessageFor(model => model.introText) %>
            </div>
            
            <p>
                <input type="submit" value="Vista" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%= Html.ActionLink("Aftur í greinalista", "Index") %>
    </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/ckeditor/ckeditor.js"></script>
</asp:Content>

